package index;

import java.io.Reader;

import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.LowerCaseFilter;
import org.apache.lucene.analysis.StopAnalyzer;
import org.apache.lucene.analysis.StopFilter;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.standard.StandardFilter;
import org.apache.lucene.analysis.standard.StandardTokenizer;

public class MyAnalyzer extends Analyzer{


	private String[] stopwords = StopAnalyzer.ENGLISH_STOP_WORDS;





	@Override
	public TokenStream tokenStream(String field, Reader reader) {
		TokenStream ts = new StandardTokenizer(reader);
		ts = new StandardFilter(ts);
		ts = new StopFilter(ts, stopwords);
		ts = new LowerCaseFilter(ts);
		return ts;		
	}



}
